using UnityEngine;

namespace BCWAccountVip
{
	public class AccountVipButtonBuy : MonoBehaviour
	{
		[SerializeField]
		private UILabel dayLabel;

		[SerializeField]
		private UILabel priceLabel;

		private string _keyIAPs;

		public string KeyIAPs
		{
			set
			{
				_keyIAPs = value;
			}
		}

		public void SetCountDay(int value)
		{
			dayLabel.text = value.ToString();
		}

		public void SetPrice(string keyInApp, float value)
		{
			if (InAppShop.instance != null)
			{
				priceLabel.text = InAppShop.instance.ConverctCurrency(keyInApp);
			}
			if (priceLabel.text == string.Empty)
			{
				priceLabel.text = value + "$";
			}
		}

		private void OnClick()
		{
			InAppShop.instance.BuyIap(_keyIAPs);
		}
	}
}
